home *** CD-ROM | disk | FTP | other *** search
- /****i* SOURCE_FILE/INFO
- *
- * NAME
- * Session.js
- *
- * USAGE
- * Part of Netobjects JavaScript Library.
- *
- * COPYRIGHT
- * Copyright ⌐ 2000-2005 Website Pros, Inc.
- * All Rights Reserved.
- *
- * This is an unpublished work protected by Website Pros, Inc.
- * as a trade secret, and is not to be used or disclosed except as
- * expressly provided in a written license agreement executed by
- * you and Website Pros, Inc.
- *
- * <copyright@websitepros.com>
- *
- * NOTES
- * JavaScript code.
- *
- *****/
-
- if (!IS.isModuleInitialized("IS.NOF.Session"))
- {
- /****h* NOF_JavaScript_Library/NOF.Session
- *
- * NAME
- * NOF.Session
- *
- * DESCRIPTION
- *
- * Class used to store informations (variables) during a Fusion session.
- * Session variables are available until the user exits Fusion.
- *
- ****/
-
- /**
- * Constructor
- */
- function NOF_Session( ) {
- this.__proto__ = NOF_Session.prototype;
- }
- {
- var member = NOF_Session.prototype;
- member.CLASS_NAME = "NOF.Session";
-
- var method = NOF_Session.prototype;
-
- /**
- * Sets the value of a new or existing session variable.
- * Session variables are available until the user exits Fusion
- *
- * @param pName name of the variable
- * @param pValue value of the session variable
- **/
- method.setVariable = function (/*String*/ pName, /*String*/ pValue) {
- NOF.App.getFSIApp().SetSessionVar(pName, pValue);
- }
-
- /**
- * Returns the value of a session variable. If the variable is not defined
- * the function will return an empty string.
- *
- * @param pName name of the variable
- * @return the value of the pName session variable
- **/
- method.getVariable = function (/*String*/ pName) {
- return NOF.App.getFSIApp().GetSessionVar(pName);
- }
-
- /**
- * SetPassword defines a password that can be used within URLs
- * In functions accepting a URL the password can then be specified using the string:
- * %pw_<passwordName>%
- * If the password name is found and the context is valid the string will be replaced by
- * the actual password.
- * The password is available only as long as Fusion is open.
- *
- * @param passwordName defines a name for the password
- * @param password defines the actual password.
- * @param context specifies the context for the password, which means that
- **/
- method.setPassword = function (/*String*/ passwordName,/*String*/ password,/*String*/ context) {
- NOF.App.getFSIApp().SetPassword(passwordName, password, context );
- }
-
- /**
- * HasPassword verify if a password was defined or not.
- * Passwords are defined using the function SetPassword.
- * @param passwordName
- * @return a boolean specifying whether a password with the specified name is defined.
- **/
- method.hasPassword = function (/*String*/ passwordName) {
- return NOF.App.getFSIApp().HasPassword(passwordName);
- }
-
- /**
- * Sets a cookie (name and value) for a specific URL.
- * The cookie will be available as long as Fusion is running, or until explicitly modified or deleted.
- *
- * @param pUrl
- * @param pName
- * @param pValue
- *
- * @return true if cookie is succesfully set
- **/
- method.setCookie = function (/*String*/ pUrl,/*String*/ pName,/*String*/ pValue) {
- return NOF.App.getFSIApp().SetCookie(pUrl, pName, pValue);
- }
-
- /**
- * Saves all cookies for a specific URL.
- * These cookies can be restored by calling RestoreCookies.
- *
- * @param pUrl
- **/
- method.saveCookies = function (/*String*/ pUrl) {
- NOF.App.getFSIApp().SaveCookies(pUrl);
- }
-
- /**
- * Restores the cookies previously saved using saveCookies for a specific URL.
- *
- * @param pUrl
- * @return true if successful, and false if saveCookies has not been called for the URL.
- **/
- method.restoreCookies = function (/*String*/ pUrl) {
- return NOF.App.getFSIApp().RestoreCookies(pUrl);
- }
-
- /**
- * Checks whether a cookie with the specified name is defined for the specified URL.
- * The cookie value cannot be read using this API.
- *
- * @param pUrl
- * @param pName
- * @return true if cookie is defined
- **/
- method.hasCookie = function (/*String*/ pUrl,/*String*/ pName) {
- return NOF.App.getFSIApp().HasCookie(pUrl, pName);
- }
-
- }
-
- NOF.__proto__.Session = new NOF_Session();
-
- }